import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralReportFileInfo = (params) => {
  params.head.transCode = 'queryGeneralReportFileInfo';
  return request({
    url: '/general/generalReportFileInfo/queryGeneralReportFileInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralReportFileInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralReportFileInfoListPage';
  return request({
    url: '/general/generalReportFileInfo/queryGeneralReportFileInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralReportFileInfo = (params) => {
  params.head.transCode = 'saveGeneralReportFileInfo';
  return request({
    url: '/general/generalReportFileInfo/saveGeneralReportFileInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralReportFileInfoList = (params) => {
  params.head.transCode = 'saveGeneralReportFileInfoList';
  return request({
    url: '/general/generalReportFileInfo/saveGeneralReportFileInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralReportFileInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralReportFileInfo';
  return request({
    url: '/general/generalReportFileInfo/saveOrUpdateGeneralReportFileInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralReportFileInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralReportFileInfoList';
  return request({
    url: '/general/generalReportFileInfo/saveOrUpdateGeneralReportFileInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralReportFileInfo = (params) => {
  params.head.transCode = 'updateGeneralReportFileInfo';
  return request({
    url: '/general/generalReportFileInfo/updateGeneralReportFileInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralReportFileInfo = (params) => {
  params.head.transCode = 'deleteGeneralReportFileInfo';
  return request({
    url: '/general/generalReportFileInfo/deleteGeneralReportFileInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralReportFileInfoList = (params) => {
  params.head.transCode = 'deleteGeneralReportFileInfoList';
  return request({
    url: '/general/generalReportFileInfo/deleteGeneralReportFileInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralReportFileInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalReportFileInfo/excelDownload/exportGeneralReportFileInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}

